package com.xiaohe66.web.domain.common.value;

import com.xiaohe66.web.integration.domain.StringValue;
import lombok.NonNull;

/**
 * @author xiaohe
 * @since 2023.01.29 14:04
 */
public class TagName extends StringValue {

    public TagName(@NonNull String value) {
        super(value);
        if (value.isEmpty()) {
            throw new IllegalArgumentException("tagName cannot be empty");
        }
        if (value.length() > 32) {
            throw new IllegalArgumentException("tagName length too long, must be less than 32");
        }
    }

    @Override
    public String toString() {
        return "TagName(" + getValue() + ")";
    }
}
